package designmode.observe;

import java.util.Observable;

public class ChangableData extends Observable {
    int age;

    public void setAge(int age) {
        this.setChanged();
        // 这里必须设置setChanged，调用后者才会生效
        this.notifyObservers();
        this.age = age;
    }
}
